import React, { Component } from 'react'
import {
  StyleSheet,
  SafeAreaView
} from 'react-native'
import NavBar from '../../components/PublicHeader';
import GroupInfo from '../GroupInfo/GroupInfo';
import UserInfo from '../UserInfo/UserInfo';

export default class my extends Component {
  constructor(props) {
    super(props)
    this.state = {

    }
  }
  info() {
    if (this.props.group != undefined) {
      return (
        <GroupInfo group={this.props.group} />
      )
    } else {
      return (
        <UserInfo user={this.props.user} />
      )
    }
  }
  componentDidMount = () => {
  }
  onPageChange(position) {
    this.setState({ current: position });
  }

  render() {
    return (
      <SafeAreaView style={styles.contens}>
        <NavBar
          navigation={this.props.navigation}
          title={this.props.group != undefined ? '群聊信息' : '个人信息'}
        />
        {this.info()}
      </SafeAreaView>
    )
  }
}
const styles = StyleSheet.create({
  contens: {
    flex: 1,
    backgroundColor: '#ffffff'
  }
})